package com.example.animatedemo;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.Animation;
import android.widget.Button;

public class BaseSlideMenuActivity extends FragmentActivity {

	protected SlideMenuDemo sm;
	protected Button mBtnShowMenu = null;
	
	@Override
	protected void onCreate(Bundle arg0) {
		// TODO Auto-generated method stub
		super.onCreate(arg0);
		
		View slideMenu = LayoutInflater.from(this).inflate(R.layout.slidemenu_main, null);
		sm = (SlideMenuDemo) slideMenu.findViewById(R.id.slide_menu);
		
		//mBtnShowMenu = (Button) slideMenu.findViewById(R.id.btn_show_menu);
		//sm.attachToActivity(this, SlideMenuDemo.SLIDING_CONTENT);
	}
	
	@Override
	protected void onPostCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onPostCreate(savedInstanceState);
		sm.attachToActivity(this, SlideMenuDemo.SLIDING_CONTENT);
	}
	
	@Override
	public void setContentView(int layoutResID) {
		// TODO Auto-generated method stub
		setContentView(getLayoutInflater().inflate(layoutResID, null));
	}
	
	@Override
	public void setContentView(View view) {
		// TODO Auto-generated method stub
		setContentView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
	}
	
	@Override
	public void setContentView(View view, LayoutParams params) {
		// TODO Auto-generated method stub
		super.setContentView(view, params);
	}
	
	@Override
	public View findViewById(int id) {
		// TODO Auto-generated method stub
		View view = super.findViewById(id);
		if (view != null) {
			return view;
		}
		return sm.findViewById(id);
	}
}
